<template>
    <div>
        <div ref="mapecharts" class="mapcs"></div>
    </div>
</template>
<script setup>
import { ref, onMounted } from 'vue'
import * as echarts from 'echarts'
import chinaJSON from './china.json'
let mapecharts = ref()
echarts.registerMap('china',chinaJSON)
onMounted(()=>{
    let mychart = echarts.init(mapecharts.value)
    mychart.setOption({
        geo:{
            map:'china',
            roam:true,
            left:50,
            top:100,
            right:50,
            label:{
                show:true,
            }
        }
    })
})
</script>
<style scoped lang="scss">
.mapcs{
    // background-color: wheat;
    height: 100%;
    width: 100%;
}
</style>